#pragma once

#include "BLL.h"
#include "DAL\DAL.h"

typedef struct
{
	unsigned int AvailableID;
	unsigned int MaximalID;
} RepositoryIDControl;

void EstablishRepository(String RootDirectoryPath);
void FinalizeRepository();

void SetRegion(Region Region);
Region GetRegion(unsigned int ID);
void DeleteRegion(unsigned int ID);
RepositoryIDControl RegionIDControl();

void SetProduct(Product Product);
Product GetProduct(unsigned int ID);
void DeleteProduct(unsigned int ID);
RepositoryIDControl ProductIDControl();

void SetContact(Contact Contact);
Contact GetContact(unsigned int ID);
void DeleteContact(unsigned int ID);
RepositoryIDControl ContactIDControl();

void SetCustomer(Customer Customer);
Customer GetCustomer(unsigned int ID);
void DeleteCustomer(unsigned int ID);
RepositoryIDControl CustomerIDControl();

void SetSupplier(Supplier Supplier);
Supplier GetSupplier(unsigned int ID);
void DeleteSupplier(unsigned int ID);
RepositoryIDControl SupplierIDControl();

void SetDelivery(Delivery Delivery);
Delivery GetDelivery(unsigned int ID);
void DeleteDelivery(unsigned int ID);
RepositoryIDControl DeliveryIDControl();

void SetDeliveryBatch(DeliveryBatch DeliveryBatch);
DeliveryBatch GetDeliveryBatch(unsigned int ID);
void DeleteDeliveryBatch(unsigned int ID);
RepositoryIDControl DeliveryBatchIDControl();

void SetSupply(Supply Supply);
Supply GetSupply(unsigned int ID);
void DeleteSupply(unsigned int ID);
RepositoryIDControl SupplyIDControl();

void SetSupplyBatch(SupplyBatch SupplyBatch);
SupplyBatch GetSupplyBatch(unsigned int ID);
void DeleteSupplyBatch(unsigned int ID);
RepositoryIDControl SupplyBatchIDControl();

//ID Control:

unsigned int GetAvailableIDForRegion();
unsigned int GetMaximalIDForRegion();

unsigned int GetAvailableIDForProduct();
unsigned int GetMaximalIDForProduct();

unsigned int GetAvailableIDForContact();
unsigned int GetMaximalIDForContact();

unsigned int GetAvailableIDForCustomer();
unsigned int GetMaximalIDForCustomer();

unsigned int GetAvailableIDForSupplier();
unsigned int GetMaximalIDForSupplier();

unsigned int GetAvailableIDForDelivery();
unsigned int GetMaximalIDForDelivery();

unsigned int GetAvailableIDForDeliveryBatch();
unsigned int GetMaximalIDForDeliveryBatch();

unsigned int GetAvailableIDForSupply();
unsigned int GetMaximalIDForSupply();

unsigned int GetAvailableIDForSupplyBatch();
unsigned int GetMaximalIDForSupplyBatch();